package com.woniu.project.service.impl;

import com.woniu.project.core.domain.ShopStore;
import com.woniu.project.dao.ShopStoreMapper;
import com.woniu.project.service.IShopStoreService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author WHF
 * @since 2020-10-12
 */
@Service
public class ShopStoreServiceImpl extends ServiceImpl<ShopStoreMapper, ShopStore> implements IShopStoreService {

    @Autowired
    private ShopStoreMapper shopStoreMapper;

    /**
     * 根据门店id删除与仓库关联
     * @param shopId 门店id
     */
    @Override
    public void deleteStores(Integer shopId) {
        shopStoreMapper.deleteStores(shopId);
    }

    /**
     * 新增门店与仓库关联
     * @param shopId 门店id
     * @param storeId 仓库id
     */
    @Override
    public void insertShopStore(Integer shopId, Integer storeId) {
        ShopStore shopStore=new ShopStore();
        shopStore.setShopId(shopId);
        shopStore.setStoreId(storeId);
        save(shopStore);
    }
}
